<?php

namespace IDock\Insurance\HBIC\Request;

use IDock\Insurance\DAJIA\Response\InsuranceOrderQueryResponse;
use IDock\Insurance\HBIC\Bean\BASEPART;
use IDock\Insurance\HBIC\Bean\CAR;
use IDock\Insurance\HBIC\Bean\CARSHIPTAX;
use IDock\Insurance\HBIC\Bean\CHANGEBASEPART;
use IDock\Insurance\HBIC\Bean\DEVICE;
use IDock\Insurance\HBIC\Bean\KIND;
use IDock\Insurance\HBIC\Bean\NOCAR;
use IDock\Insurance\HBIC\Bean\PERSONNEL;
use IDock\Insurance\HBIC\Response\CommonResponse;

class SmsCodeVerifyAndSubmitRequest extends AllHBICRequest
{
    protected $requestType = '249';
    protected $comCode = '2500000000';

    protected $methodName = 'acquiresaveVerificationCode';

    protected $resourceType = 'HBEP';

    protected $response = CommonResponse::class;

    protected $urlTip = '获取或提交验证码接口';
    protected $verificationType = '';
    protected $businessNo = '';
    protected $riskCode = '';
    protected $businessType = '';
    protected $verificationCode = '';

    public function generate(): array
    {
        $param = [
            'head' => [
                'requestType' => '0022',
                'messageId' => 'ebcd0efb-c435-43a1-8e2b-b9f7c13559e2',
                'userId' => '',
                'passWord' => '',
                'ComCode' => ''
            ],
            'body' =>
                [
                    'resourceType' => $this->resourceType,
                    'methodName' => $this->methodName,
                    'baseInfo' => [
                        'verificationType' => $this->verificationType,
                        'businessNo' => $this->businessNo,
                        'riskCode' => $this->riskCode,
                        'businessType' => $this->businessType,
                        'verificationCode' => $this->verificationCode,
                    ]]
        ];

        foreach ($param['body'] as $key => $val) {
            if (empty($val)) {
                unset($param['body'][$key]);
            }
        }
        return $param;
    }

    /**
     * @param string $verificationType
     */
    public function setVerificationType(string $verificationType): void
    {
        $this->verificationType = $verificationType;
    }

    /**
     * @param string $businessNo
     */
    public function setBusinessNo(string $businessNo): void
    {
        $this->businessNo = $businessNo;
    }

    /**
     * @param string $riskCode
     */
    public function setRiskCode(string $riskCode): void
    {
        $this->riskCode = $riskCode;
    }

    /**
     * @param string $businessType
     */
    public function setBusinessType(string $businessType): void
    {
        $this->businessType = $businessType;
    }

    /**
     * @param string $verificationCode
     */
    public function setVerificationCode(string $verificationCode): void
    {
        $this->verificationCode = $verificationCode;
    }


}